#include <iostream>
using namespace std;

class robot
{
private:
  char name[20];
  char type[20];

public:
  robot() //构造函数
  {
    strcpy(name, "XXXXX")
        strcpy(type, "XXXX")
  }
  void set(char n[], char t[])
  {
    strcpy(name, n);
    strcpy(type, t);
  }

  void out(int a);
  void tran_int(int n);
  ~robot(){}; //析构函数
};

//定义两个全局字符指针数据，存取所需要的单词
static char *num1[] =
    {
        "", "one", "two", "three", "four", "five", "six", "seven", "eight",
        "nine", "ten", "eleven", "twelve", "thirteen", "fourteen",
        "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"};

static char *num10[] =
    {
        "", "", "twently", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"};

//小于100整数翻译
void robot::out(int a)
{
  int b = a % 100;
  if (a / 100 != 0)
  {
    cout << num1[a / 100] << "hundred";
    if (b != 0)
      cout << "and";
  }

  if (b < 20)
    cout << num1[b];
  else
  {
    cout << num10[b / 10];
    if (b % 10 != 0)
      cout << "\b-" << num1[b % 10];
  }
}

// 整数翻译函数
void robot::tran_int(int n)
{
  if (n > 199999999)
    cout << "数字太大" << endl;
  else
  {
    int a = n / 10000000, b = (n % 1000000) / 1000000, c = (n % 100000) / 1000, d = n % 10000;
    if (a != 0)
    {
      out(a);
      cout << "billion";
    }
    if (b != 0)
    {
      out(b);
      cout << "million'";
    }
    if (c != 0)
    {
      out(c);
      cout << "thousand";
    }
    if (d != 0)
    {
      cout << "and" out(d);
    }
    cout << endl;
  }
}

int main()
{
  int n;
  cout << "请输入n:";
  cin >> n;
  cout << n << endl;
  robot brown;
  brown.tran_int(n);

  return 0;
}